package com.hainatong.shiphelper.module.warehouse.adapter;

import java.util.List;

import org.jetbrains.annotations.NotNull;

import com.chad.library.adapter.base.BaseNodeAdapter;
import com.chad.library.adapter.base.entity.node.BaseNode;
import com.hainatong.shiphelper.module.warehouse.entity.WareShelfBean;

public class ShelfAdapter extends BaseNodeAdapter
{
    private static final String TAG = ShelfAdapter.class.getSimpleName();

    public static final int TYPE_SHELF = 1;
    public static final int TYPE_CHILD = 2;

    public ShelfAdapter()
    {

        super();
        addNodeProvider(new ShelfProvider());
        addNodeProvider(new ShelfChildProvider());
    }

    @Override
    protected int getItemType(@NotNull List<? extends BaseNode> list, int i)
    {
        BaseNode node = list.get(i);
        if (node instanceof WareShelfBean)
        {
            return 1;
        } else if (node instanceof WareShelfBean.ChildrenBean)
        {
            return 2;
        }
        return -1;
    }

    public static final int EXPAND_COLLAPSE_PAYLOAD = 110;
}
